<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="viewport" content="width=device-width,maximum-scale=1,initial-scale=1.0,user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>北京市职业介绍服务信息系统</title>
  <script type="text/javascript">
    if (/(iPhone)|(Android)/.test(navigator.userAgent)) {
      document.documentElement.style.fontSize = document.documentElement.clientWidth / 10 + 'px';
    }
  </script>
  <style>
    html,
    body {
      margin: 0;
      padding: 0;
    }

    .footer {
      border-top: 3px solid #246fde;
      background-color: #cde3f9;
      padding: 20px 0;
      min-width: 928px;
      text-align: center;
      font-size: 12px;
      color: #334b70;
    }

    .footer p {
      margin: 0 auto 8px;
    }

    .message {
      /*width: 100%;*/
      min-width: 928px;
      background-color: #ebf6ff;
      padding: 26px 0 26px;
      box-sizing: border-box
    }

    /* 登陆超时 */

    .content.on {
      height: 515px;
      padding-top: 24px;
      width: 928px;
      margin: 0 auto;
    }

    .error {
      width: 100%;
      height: 515px;
      background-color: #fff;
    }

    .error img {
      margin: 142px 0 0 404px;
      width: 115px;
      height: 131px;
    }

    .error p {
      width: 300px;
      font-weight: 600;
      margin: 20px auto 30px;
      text-align: center;
    }

    .error .btns {
      width: 96px;
      height: 30px;
      line-height: 30px;
      border: 1px solid #246fde;
      border-radius: 20px;
      text-align: center;
      margin: 0 auto;
      color: #246fde;
      cursor: pointer;
    }

    .error .btns.on {
      margin-left: 30px;
    }

    .error .anniu {
      width: 230px;
      margin: 0 auto;
    }

    .error-wrap .message {
      min-height: 570px;
    }

    .error .images {
      height: 131px;
    }

    .nodata {
      text-align: center;
      padding: 15px 0;
      color: #666;
    }

    .errornew {
      display: none;
    }

    /* 错误页面自适应 */

    @media screen and (max-width:480px) {
      .all {
        display: none;
      }
      .errornew {
        padding-top: 3.33333rem;
        font-size: 0.44444rem;
        display: block;
      }
      .content_error {
        text-align: center;
        margin-bottom: 1.77778rem;
      }
      .content_error .icon {
        display: inline-block;
        height: 3.16667rem;
        width: 2.80556rem;
        text-align: center;
      }
      .content_error p {
        margin: 0;
        padding: 0.44444rem;
        border: 0;
        outline: 0;
        font-size: 0.44444rem;
        vertical-align: baseline;
        background: transparent;
      }
      .content_error .btn {
        background-color: #fff;
        color: #246fde;
        border: 1px solid #246fde;
        border-radius: 1.37037rem;
        font-size: 0.44444rem;
        padding: 0.22222rem 0.88889rem;
        width: auto;
        box-sizing: border-box;
      }
    }

    .error .btn {
      width: 146px;
      height: 30px;
      padding: 0 10px;
      line-height: 30px;
      border: 1px solid #246fde;
      border-radius: 20px;
      text-align: center;
      margin: 0 auto;
      color: #246fde;
      cursor: pointer;
    }
  </style>
</head>

<body>
  <div class="all">
    <!-- 提示开始 -->
    <div class="message">
      <div class="content on">
        <div class="error">
          <img src="./styles/imgs/offline.png" alt="">
          <p>服务起开小差，请返回用户定制中心</p>
          <div class="btn">返回用户定制中心</div>
        </div>
      </div>
    </div>
    <!-- 提示结束 -->
    <!-- 尾部开始 -->
    <div class="footer">
      <p>北京市人力资源和社会保障局 版权所有</p>
      <p>ICP备案序号：京ICP备05056884号 公安机关备案号：110102000777</p>
    </div>
    <!-- 尾部结束 -->
  </div>
  <div class="errornew">
    <div class="content_error">
      <img class="icon" src="./styles/imgs/offline.png" />
      <p class="text error_msg">服务起开小差，请返回用户定制中心</p>
      <button class="btn btn-round">返回用户定制中心</button>
    </div>
  </div>
</body>
<script src="./common/vendor.js"></script>
<script>
  $(function() {
    /**
     * 不同的设备跳转到用户定制中心的不同地址，职介项目应该返回到“就业超市 conf.urlBx”
     */
    function toUserCenter() {
      if (/(iPhone)|(Android)|(Mobile)/.test(navigator.userAgent)) {
        window.location.href = 'http://www.bjrbj.gov.cn/mplatform/main.ht';
      } else {
        window.location.href = 'http://www.bjrbj.gov.cn/platform/main.ht';
      }
    }
    // if (!location.search) {
    //   toUserCenter();
    // }
    /* 获取参数 */
    $.paramObj = function() {
      if (window.location.search.indexOf('?') !== -1) {
        var cs = window.location.search.split('?')[1].split('&');
        var str = '{';
        for (var i = 0; i < cs.length; i++) {
          var obj = cs[i].split('=');
          if (i === (cs.length - 1)) {
            str = str + '\"' + obj[0] + '\"' + ':' + '\"' + decodeURI(obj[1]) + '\"}';
          } else {
            str = str + '\"' + obj[0] + '\"' + ':' + '\"' + decodeURI(obj[1]) + '\",';
          }
        }
        var csobj = JSON.parse(str);
        return csobj;
      }
      return '';
    };
    var code = $.paramObj().code;
    if (code === '1') {
      msgSetting('证件类型不是身份证，请重新登录！');
    } else if (code === '2') {
      msgSetting('身份证号码不合法，请重新登录！');
    } else if (code === '3') {
      msgSetting({
        text: '未检测到手机号，请进入用户定制中心绑定手机号！',
        src: './styles/imgs/warning.png',
        btnText: '绑定手机号码'
      });
    } else if (code === '4') {
      msgSetting('登录超时，请重新登录！');
    } else if (code === '5') {
      msgSetting('姓名不合法，请重新登录！');
    } else {
      msgSetting({
        text: '服务器开小差，请稍后重试！',
        src: './styles/imgs/exception.png',
        btnText: '返回用户定制中心'
      });
    }
    // 退出登录
    $(document).on('click', '.btn', function() {
      var codeList = '1245';
      if (!code || codeList.indexOf(code) < 0) {
        if (/(iPhone)|(Android)|(Mobile)/.test(navigator.userAgent)) {
          window.location.href = 'http://www.bjrbj.gov.cn/mplatform/main.ht';
        } else {
          window.location.href = 'http://www.bjrbj.gov.cn/platform/main.ht';
        }
      } else if (code === '4') {
        if (/(iPhone)|(Android)|(Mobile)/.test(navigator.userAgent)) {
          window.location.href = './zymbjc/index.html';
        } else {
          window.location.href = './weixin/index.html';
        }
      } else {
        sessionStorage.removeItem('grxx');
        sessionStorage.removeItem('jdcx');
        window.location.href = conf.urlPrefix + '/logout';
      }
    });
    /**
     * 样式文字设置
     * @param {Object} obj
     * @param {String} obj.text 提示文字
     * @param {String} obj.src 背景图片地址
     * @param {String} obj.btnText 按钮文字
     */
    function msgSetting(obj) {
      if (typeof obj === 'string') {
        return $('.error p, .errornew .error_msg').text(obj);
      }
      obj.text && $('.error p,.errornew .error_msg').text(obj.text);
      obj.src && $('.error img,.errornew .icon').attr('src', obj.src);
      obj.btnText && $('.error .btns, .errornew .btn').text(obj.btnText);
    }
    // 退出登录
    $(document).on('click', '.btn', function() {
      toUserCenter();
    });
  });
</script>

</html>